home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-07 | 1.6 KB | 68 lines | [TEXT/MPS ] |
- (*
- CTBSendDone() -- Return true if there is a write which has not completed yet.
-
- To compile and link this file using Macintosh Programmer's Workshop,
-
- pascal -w CTBSendDone.p
- link -m ENTRYPOINT -o HyperCommands -rt XFCN=2762 -sn Main=CTBSendDone ∂
- CTBSendDone.p.o "{MPW}"Libraries:interface.o "{MPW}"Libraries:Libraries:HyperXLib.o
-
- © Copyright 1990 by Apple Computer, Inc.
-
- Initial coding 2/90 by Harry R. Chesley.
- *)
-
- {$R-}
-
- {$S CTBSendDone } { Segment name must be the same as the command name. }
-
- unit DummyUnit;
-
- interface
-
- uses MemTypes, QuickDraw, OSIntf, ToolIntf, CTBUtils, FTIntf, CMIntf, TMIntf, CRMIntf, HyperXCmd;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- implementation
-
- procedure CTBSendDone(paramPtr: XCmdPtr); forward;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- begin
- CTBSendDone(paramPtr);
- end;
-
- procedure CTBSendDone(paramPtr: XCmdPtr);
-
- {$I CTBUtil.inc}
-
- var sizes: CMBufferSizes;
- status: CMStatFlags;
- s: Str255;
-
- procedure Fail(errMsg: Str255); { set theResult and quit }
- begin
- paramPtr^.returnValue := PasToZero(paramPtr,errMsg);
- exit(CTBSendDone);
- end;
-
- begin
- { Check the parameter count. }
- if paramPtr^.paramCount <> 0 then Fail('Invalid parameter count');
-
- { Check that the Comm Toolbox is here. }
- CTBReady;
-
- { Get the outstanding bytes info. }
- if Globals^^.connHand = nil then status := 0
- else if CMStatus(Globals^^.connHand,sizes,status) <> noErr then status := 0;
- { Convert it to a string and return it. }
- if BAnd(status,cmStatusDWPend) <> 0 then s := 'false'
- else s := 'true';
- paramPtr^.returnValue := PasToZero(paramPtr,s);
- end;
-
- end.
-